package com.wavehi.native_component.web.filter;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

/**
 * @Author WaveHi
 * @Date 15/11/2021 下午 10:06
 * @Version 1.0
 * @Contact HJBWaveHi@163.com
 * @Description
 */
//@WebFilter(urlPatterns = {"/css", "/js", "/myServlet"})
public class MyFilter implements Filter {

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        System.out.println("MyFilter init!");
    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse,
                         FilterChain filterChain) throws IOException, ServletException {
        System.out.println("MyFilter does work!");
        filterChain.doFilter(servletRequest, servletResponse);
    }

    @Override
    public void destroy() {
        System.out.println("MyFilter destroy!");
    }
}
